package routines;

import org.hibernate.Session;

public class DAOCustomerInfo extends DAO{
	
	public static CustomerInfo getByRegnumber(String reg) throws Exception{
		CheckSession();
		if(reg==null)
			throw new Exception("regnumber can not be null!");
		CustomerInfo c = (CustomerInfo) session.createQuery("from CustomerInfo where regNumber = :reg").setString("reg", reg).uniqueResult();
		return c;
	}

}
